const express = require("express");
const router = express.Router();
const {
  getCodeCountListByDateController,
  sendMailController,
  codeCountListSummaryController,
  softDeleteCodeCountDetailController,
  countReposController,
  quarterController,
  previewEmailController,
  getCodeCountListByBranchIdController,
  getGroupSummaryByBranchIdController,
  getBranchSummaryController
} = require("../controller/codeCount");

// 代码统计列表（所有部门）
router.post("/code-count/list", getCodeCountListByDateController);

// 代码统计列表(指定部门)
router.post("/code-count/list-by-branch", getCodeCountListByBranchIdController);

// 显示部门下，每组指定季度范围内统计数据之和(指定部门)
router.post(
  "/code-count/branch/group-summary",
  getGroupSummaryByBranchIdController
);

// 指定部门数据汇总(返回一条数据 新增、删除、总和)
router.post("/code-count/branch-summary", getBranchSummaryController);

// 统计数据软删除
router.delete("/code-count/list/:rid", softDeleteCodeCountDetailController);

// 返回 2021Q4至今， 所有季度的数据(去除被标记删除的数据)
router.post("/code-count/summary", codeCountListSummaryController);

// 返回从2021Q4开始至今的季度列表数据
router.post("/code-count/quarter-list", quarterController);


// 代码统计邮件重发
router.post("/email/resend", sendMailController);

// 数据补全
router.post("/static/count-repos", countReposController);

// 邮件预览
router.get("/preview-email/:nyrDate", previewEmailController);

module.exports = router;
